package org.jsoft.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.jsoft.dao.SellDAO;

public class SellDaoDelServlet extends HttpServlet{
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {

		this.doPost(req, resp);
	}

	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		
		
		int sellId=Integer.parseInt(req.getParameter("sellId"));

		String err="";
			SellDAO selldao= new SellDAO();
			if(selldao.delSell(sellId)){
				resp.sendRedirect("/Club/jsp/selldel.jsp");
			}else{
				err="del user is err";
				resp.sendRedirect("/Club/jsp/selldel.jsp?err="+err);
			}
	}
}